package com.example.demo02.constants;


/**
 * 项目枚举类
 */
public class Constants {

    public static final Integer SYSTEM_CUSTOM_ERROR = 1;
    public final static String DEFAULT_ERROR_MESSAGE = "服务器异常，请稍后重试";
    public static final Integer SUCCESS = 0;
    public static final Integer FAIL = 1;
    public static final Integer NO_LOGIN = 2;

    /**
     * 官网对应的API——from属性
     */
    public static final String API_FROM = "4";

    //密码盐值
    public static final String PASSWORD_STAL = "sunland2021";

    /**
     * 默认的访问Token的HTTP请求头的名字
     */
    public static final String ACCESS_TOKEN_HEADER_NAME = "X-Access-Auth-Token";

    /**
     * 支付宝用户USERID的HTTP请求头的名字
     */
    public static final String ALIPAY_USER_ID_HEADER_NAME = "Yd_Alipay_User_Id";

    /**
     * 缓存用户的key,USER_; USER_1
     */
    public static final String SERVER_USER_KEY = "USER_";

    /**
     * 用户过期时间(单位:秒，1天)
     */
    public static final int SERVER_USER_EXP_KEY = 60 * 60 * 24 * 1;

    /**
     * 端来源-请求头key
     */
    public static final String REQUEST_SIDE_HEAD_NAME = "X-REQUEST-SIDE";

    /**
     * 系统参数缓存前缀
     */
    public static final String CACHE_GLOBAL_CONFIG_PREFIX = "CACHE_GLOBAL_CONFIG_";
    /**
     * 系统参数缓存数据 7天
     */
    public static final int CACHE_GLOBAL_CONFIG_SECOND = 86400 * 7;

    /**
     * 周榜缓存7天
     */
    public static final int WEEK_RANK_EXPIRE_TIME = 86400 * 7;

    /**
     * 菜单类型-后台管理
     */
    public static final String MENUTYPE_MANAGER = "1";
    /**
     * 菜单类型-前台-终端
     */
    public static final String MENUTYPE_FRONT = "2";
    /**
     * 状态-无效
     */
    public static final String STATE_INVALID = "0";
    /**
     * 状态-有效
     */
    public static final String STATE_VALID = "1";


    /**
     * 默认-默认违法行为
     */
    public static final String WFXW_7003 = "7003";

    /**
     * 默认-默认违法行为
     */
    public static final int FKJE_150 = 150;
    /**
     * 默认-用户密码
     */
    public static final String DEFAULT_PASSWORD = "000000";

    public static final String DEFAULT_SUPERVISOR_PASSWORD = "000000";

    /**
     * 执行状态--成功
     */
    public static final String SERVER_STATUS_SUCCESS = "1";
    /**
     * 执行状态--不成功(针对类似  --对账不成功---的返回类型)
     */
    public static final String SERVER_STATUS_NOTSUCCESS = "2";
    /**
     * 执行状态--失败
     */
    public static final String SERVER_STATUS_FAIL = "0";

    public static final String CFSJ = "2";

    /**
     * 通知单领用状态--2民警领用
     */
    public static final int MINGJING_USERD_BILL_STATE = 2;//2-民警领用

    public static final int MINGJING_UPDATE_BILL_STATE = 3;//2-民警领用

    /*各个大队的录入时间*/
    public static final String VIO_INSERT_DATA = "VIO_INSERT_DATA";
    public static final String VIO_INSERT_SHIJU = "VIO_INSERT_SHIJU";
    public static final String VIO_INSERT_ZHUJI = "VIO_INSERT_ZHUJI";


    public static final String THE_SAME_VIO_DATA = "THE_SAME_VIO_DATA";

    /**
     * 告知单后台管理功能 (1启用  0未启用)
     */
    public static final String IS_BILL_STARTED = "IS_BILL_STARTED";//
    public static final String MAX_UPLOAD_IMG_SIZE = "MAX_UPLOAD_IMG_SIZE";//
    public static final String IMAGES_PATH = "IMAGES_PATH";//

    public static final String DD_YCCL_PER = "DD_YCCL_PER";//
    /**
     * 返回错误信息
     */
    public static final String ERROR_UNKOWN = "未知错误！";
    /**
     * 返回错误信息
     */
    public static final String ERROR_BUSINESS_SAVE_BATCHNOCHECK = "该业务批次号尚未对账，对账失败才能新增业务！";
    /**
     * 返回错误信息
     */
    public static final String ERROR_BUSINESS_SAVE_BATCHCHECKED = "该业务批次号已对账完成，无法新增业务！";
    /**
     * 返回错误信息
     */
    public static final String ERROR_BUSINESS_SAVE_EXISTE = "业务数据已存在，无法保存！";
    /**
     * 票据退还成功提示信息
     */
    public static final String INVOICE_BACK_SUCCESS_INFO = "退还成功！";
    /**
     * 票据退还失败提示信息
     */
    public static final String INVOICE_BACK_FAIL_INFO = "服务异常，退还失败！";
    /**
     * 票据作废成功提示信息
     */
    public static final String INVOICE_DEL_SUCCESS_INFO = "作废成功！";
    /**
     * 票据作废失败提示信息
     */
    public static final String INVOICE_DEL_FAIL_INFO = "服务异常，作废失败！";
    /**
     * 票据取消作废成功提示信息
     */
    public static final String INVOICE_CANCELDEL_SUCCESS_INFO = "取消作废成功！";
    /**
     * 票据取消作废失败提示信息
     */
    public static final String INVOICE_CANCELDEL_FAIL_INFO = "服务异常，取消作废失败！";
    /**
     * 返回错误信息
     */
    public static final String ERROR_DATABASE = "数据库异常！";
    /**
     * 票据管理员权限
     */
    public static final int INVOICE_PERMISSION_VALUE = 51;
    /**
     * 票据权限校验不通过提示信息
     */
    public static final String INVOICE_PERMISSION_INFO = "您不是票据管理员，不能对票据进行操作！";
    /**
     * 票据领用成功提示信息
     */
    public static final String INVOICE_LY_SUCCESS_INFO = "领用成功！";
    /**
     * 票据领用失败提示信息
     */
    public static final String INVOICE_LY_FAIL_INFO = "服务异常，领用失败！";
    /**
     * 市局下发，大队领用
     */
    public static final String INVOICE_LY_DD = "0";
    /**
     * 大队下发，中队领用
     */
    public static final String INVOICE_LY_ZD = "1";
    /**
     * 中队下发，民警领用
     */
    public static final String INVOICE_LY_USER = "2";
    /**
     * 市局票据校验不通过提示信息
     */
    public static final String INVOICE_CHECK_INFO = "该票据起止号不满足下发规则，无法下发";
    /**
     * 发票状态，大队领用
     */
    public static final int INVOICE_STATE_DD = 0;
    /**
     * 发票状态，中队领用
     */
    public static final int INVOICE_STATE_ZD = 1;
    /**
     * 发票状态，民警领用
     */
    public static final int INVOICE_STATE_USER = 2;
    /**
     * 发票状态，已使用
     */
    public static final int INVOICE_STATE_USED = 3;
    /**
     * 发票状态，已入库
     */
    public static final int INVOICE_STATE_NOLY = 8;
    /**
     * 发票状态，作废
     */
    public static final int INVOICE_STATE_DEL = 9;
    /**
     * 票据入库成功提示信息
     */
    public static final String INVOICE_INSERT_SUCCESS_INFO = "票据入库成功！";
    /**
     * 票据入库失败提示信息
     */
    public static final String INVOICE_INSERT_FAIL_INFO = "服务异常，票据入库失败！";
    /**
     * 票据段已存在提示信息
     */
    public static final String INVOICE_INSERT_EXIST_INFO = "该票据段已存在，请检查后入库！";
    /**
     * 票据下发成功提示信息
     */
    public static final String INVOICE_XF_SUCCESS_INFO = "下发成功！";
    /**
     * 市局票据管理员
     */
    public static final String INVOICE_LEVELNAME_SJ = "市局票据管理员";
    /**
     * 大队票据管理员
     */
    public static final String INVOICE_LEVELNAME_DD = "大队票据管理员";
    /**
     * 中队票据管理员
     */
    public static final String INVOICE_LEVELNAME_ZD = "中队票据管理员";


    /**
     * 市局部门级别
     */
    public static final String DEPT_LEVEL_SJ = "0";
    /**
     * 大队部门级别
     */
    public static final String DEPT_LEVEL_DD = "1";
    /**
     * 中队部门级别
     */
    public static final String DEPT_LEVEL_ZD = "2";

    /**
     * 检验驾驶证号不能为空
     */
    public static final String VALID_JSZH_NULL = "驾驶证号码不能为空!";
    /**
     * 检验驾驶证号是否通过
     */
    public static final String VALID_JSZH = "驾驶证号码校验不通过!";
    /**
     * 检验机构代码不能为空
     */
    public static final String VALID_JGDM_NULL = "无法获取机构代码，不能进行案件处理!";
    /**
     * 处理成功
     */
    public static final String VIO_DEAL_SUCCESS = "处理成功！";
    /**
     * 处理失败
     */
    public static final String VIO_DEAL_FAIL = "处理失败！";
    /**
     * 检验处罚决定书编号
     */
    public static final String VALID_JDSBH = "无法生成处罚决定书编号!";
    /**
     * 撤销处理成功
     */
    public static final String VIO_REVOKE_DEAL_SUCCESS = "撤销处理成功！";
    /**
     * 撤销处理失败
     */
    public static final String VIO_REVOKE_DEAL_FAIL = "撤销处理失败！";


    /**
     * 加锁异常
     */
    public static final String MANUAL_LOCK_EXCEPTION = "提交加锁异常！";
    /**
     * 加锁失败
     */
    public static final String MANUAL_LOCK_FAILINFO = "提交加锁失败！";
    /**
     * 加锁成功
     */
    public static final String MANUAL_LOCK_SUCCESSINFO = "提交加锁成功！";
    /**
     * 加锁异常
     */
    public static final String MANUAL_UNLOCK_EXCEPTION = "提交加锁异常！";
    /**
     * 解锁失败
     */
    public static final String MANUAL_UNLOCK_FAILINFO = "提交解锁失败！";
    /**
     * 解锁成功
     */
    public static final String MANUAL_UNLOCK_SUCCESSINFO = "提交解锁成功！";
    /**
     * 提交加锁成功
     */
    public static final String LOCK_STATE_Y = "Y";
    /**
     * 提交加锁失败
     */
    public static final String LOCK_STATE_N = "N";
    /**
     * 提交解锁成功
     */
    public static final String UNLOCK_STATE_Y = "Y";
    /**
     * 提交解锁失败
     */
    public static final String UNLOCK_STATE_N = "N";

    /**
     * 通知成功
     */
    public static final String VIO_NOTICE_SUCCESSINFO = "通知成功！";
    /**
     * 通知失败
     */
    public static final String VIO_NOTICE_FAILINFO = "通知失败！";
    /**
     * 通知异常
     */
    public static final String VIO_NOTICE_EXCEPTION = "通知异常！";

    /*公众服务网站接口地址*/
    public final static String SERVER_API_URL = "";
//			ParamUtils.getParametersString("SERVER_API_URL_PUBLIC");

//    /*公众服务网站接口地址*/
//    public final static String SERVER_API_URL = ParamUtils.getParametersString("SERVER_API_URL");
//
//    /*公众服务网站接口测试地址*/
//    public final static String SERVER_API_URL_PUBLIC = ParamUtils.getParametersString("SERVER_API_URL_PUBLIC");

    public static final String OPERATE_FAIL = "操作失败";

    public static final String IMAGES_ADDRESS = "IMAGES_ADDRESS";

    public static final String SESSION_ERROR = "session会话不存在或已过期，请重新登录";

    //接口返回的代码 1-失败 0-成功
    public static final String CODE_SESSIONOUT = "401";
    public static final String CODE_FAIL = "1";
    public static final String CODE_SUCCESS = "0";


    /*ftp配置*/
    public static final String IMAGES_FTP_USER = "IMAGES_FTP_USER";
    public static final String IMAGES_FTP_PASSWD = "IMAGES_FTP_PASSWD";
    public static final String IMAGES_FTP_URL = "IMAGES_FTP_URL";
    public static final String IMAGES_FTP_PORT = "IMAGES_FTP_PORT";
    /*服务器FTP编码格式*/
    public static final String FTP_SERVER_CODEING = "UTF-8";
    /*本地FTP编码格式*/
    public static final String FTP_LOCAL_CODEING = "GBK";
    public static final String SYSTEM_ADDRESS = "SYSTEM_ADDRESS";

    //时间格式
    public static String getDateFormat(int kind) {
        String[] format = {
                "yyyy-MM-dd", //0
                "yyyy-MM-dd HH:mm:ss", //1
                "yyyy",//2
                "M",//3
                "dd", //4
                "yyyy年M月d日H点m分", //5
                "yyyy年M月d日", //6
                "H点m分", //7
                "yyyy-MM-dd HH:mm", //8
                "HH",//9
                "mm",//10
                "yyyyMMdd", //11
                "yyyyMMddHHmmss", //12
                "yyyy-MM-dd 23:59:59", //13
                "yyyy 年 M 月 d 日", //14
                "yyyy年MM月dd日HH时mm分",//15
                "yyyy 年  M 月  d 日  H 点  m 分", //16
                "HHmmss",//17
                "HHmm",//18
                "HH:mm",//19
                "yyyyMM"//20

        };
        return format[kind];
    }

    /**
     *      * @param args
     *      *            add by zxx ,Nov 29, 2008
     *     
     */
    private static final char[] data = new char[]{'零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'};
    private static final char[] units = new char[]{'元', '拾', '佰', '仟', '万', '拾', '佰', '仟', '亿'};

    //暂时废弃，原因为多了50转为伍拾零元，多了零字
//    public static String convert(int money) {
//        StringBuffer sbf = new StringBuffer();
//        int unit = 0;
//        while (money != 0) {
//            sbf.insert(0, units[unit++]);
//            int number = money % 10;
//            sbf.insert(0, data[number]);
//            money /= 10;
//        }
//        return sbf.toString();
//    }


    //调查笔录案件种类
    public final static String TYPE_CFKYBL = "6";
    public final static String TYPE_JSDCBL = "5";
    public final static String TYPE_ZLZG = "1";
    public final static String TYPE_JSDC = "2";
    public final static String TYPE_XCBL = "3";
    public final static String TYPE_CFJDS = "4";

    public final static String IMGTYPE_IMG = "1";

    public final static String IMGTYPE_VIDEO = "2";

    public final static String MOULD_TYPE_NOASK = "2";

    public final static String MOULD_TYPE_ASK = "1";

    //书籍类型--（对应book_type的pid）
    public final static Integer BOOKTPE_ALL = 1;
    public final static Integer BOOKTPE_LAW = 2;

    //操作类型
    public final static String ACTION_DELETE = "00";
    public final static String ACTION_ADD = "01";
    public final static String ACTION_UPDATE = "02";
    public final static String ACTION_VERIFY = "03";

    //财物操作类型
    public final static String ARTICLE_INPUT = "1";
    public final static String ARTICLE_OUTAPPLY = "2";
    public final static String ARTICLE_APPLYCANCEL = "3";
    public final static String ARTICLE_AGREE = "4";
    public final static String ARTICLE_DISAGREE = "5";
    public final static String ARTICLE_TAKE = "6";
    public final static String ARTICLE_REOUTAPPLY = "7";
    public final static String ARTICLE_DEL = "8";

    public final static String ARTICLE_FLOW_DISAGREE = "2";
    public final static String ARTICLE_FLOW_AGREE = "1";

    public final static Integer DEPTLEVEL_SUPER = 0;
    public final static Integer DEPTLEVEL_FIRST = 1;
    public final static Integer DEPTLEVEL_SECOND = 2;
    public final static Integer DEPTLEVEL_THIRD = 3;

    public final static String CFFS_WRAN = "1";  //警告

    public final static String CFFS_FINE = "2";  //罚款

    /**
     * 短信验证码有效时间(秒)， 5分钟
     */
    public static final int SMS_VALID_TIME = 300;
    /**
     * 短信验证码发送冷却时间(秒) 1分钟
     */
    public static final int SMS_COOL_TIME = 60;

    /**
     * 运营单位最高节点id 0
     */
    public static final Integer OPTUNIT_ROOT_ID = 0;

    /**
     * 编码格式
     *
     * @author peidawei@zbj.com
     */
    public enum EncodeingEnum {
        GBK("GBK"), UTF8("UTF-8");
        private String code;

        public String getCode() {
            return code;
        }

        EncodeingEnum(String code) {
            this.code = code;
        }
    }


}
